package com.hl.card.modular.packBack.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baomidou.mybatisplus.plugins.Page;
import com.hl.card.common.constant.factory.PageFactory;
import com.hl.card.common.controller.BaseController;
import com.hl.card.common.persistence.model.CreditCardLog;
import com.hl.card.modular.packBack.service.CreditCardLogService;


@Controller
@RequestMapping("/creditCardLog")
public class CreditCardLogController extends BaseController{
	private String PREFIX = "/packback/credit_card_log/";
	@Autowired
	private CreditCardLogService creditCardLogService;
	
	
	/**
	 * 跳转列表
	 * 
	 * @return
	 */
	@RequestMapping("")
	public String index() {
		return PREFIX + "credit_card_log.html";
	}

	
	/**
	 * 查询列表
	 * 
	 * @param user
	 * @return
	 */
	@RequestMapping("/list")
	@ResponseBody
	public Object list(CreditCardLog log, HttpServletRequest request) {
		String sort = request.getParameter("sort");
		String order = request.getParameter("order");
		Page<CreditCardLog> page = new PageFactory<CreditCardLog>().defaultPage();
		List<CreditCardLog> list = creditCardLogService.list(page, log, sort,order);
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("rows", list);
		result.put("total", page.getTotal());
		return result;
	}
}
